home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: seebs@solutions.solon.com (Peter Seebach)
- Newsgroups: comp.lang.c
- Subject: Re: Schildt <- Advanced Books
- Date: 8 Mar 1996 20:29:55 -0600
- Organization: Usenet Fact Police (Undercover)
- Message-ID: <4hqqf3$445@solutions.solon.com>
- References: <8BA8405.02C70020DE.uuout@sourcebbs.com> <danpop.826238706@rscernix> <4ho3m3$iov@solutions.solon.com> <danpop.826305987@rscernix>
- NNTP-Posting-Host: solutions.solon.com
-
- In article <danpop.826305987@rscernix>, Dan Pop <danpop@mail.cern.ch> wrote:
- >My compiler _will_ warn about illegal integer to pointer conversion
- >and I NEVER ignore such a warning. Moreover, even the silly cast in front
- >of malloc won't prevent gcc from telling me that something silly is
- >happening:
-
- > ues5:~/tmp 30> cat test.c
- > main()
- > {
- > char *p = (char *)malloc(100);
- > }
- > ues5:~/tmp 31> gcc test.c
- > test.c: In function `main':
- > test.c:3: warning: cast to pointer from integer of different size
-
- >But this is because I have the "privilege" of using a system where
- >pointers and int's have different sizes. It's amazing how much new free
- >software has to be fixed, even today, three years after the Alpha boxes
- >have hit the market.
-
- Yes; there's some debate about this and related issues in gnu.misc.discuss.
-
- I don't ignore warnings either, though I sometimes have to fight the system
- to get them.
-
- >>The same book, at one point, declares
- >> char *buf[128];
- >>and passes the buffer to something like fgets().
-
- >I'd stay away from any book which has untested examples. We are all
- >human and we all make mistakes, but any serious author will, at least,
- >compile his examples to be sure they're correct and will introduce the
- >source code directly into the "manuscript", to be sure that no typo could
- >find its way in. Many authors even document this practice, somewhere in
- >the preface (e.g. the last phrase on page ix of K&R2).
-
- I actually find the book overall pretty good. It's a book on XView, which
- means, there's no possible way to write legal code for it. :)
-
- I am pretty sure that most of the code in the book was brought in from
- source files; the source is available from their ftp site.
-
- My guess would be that the '=^=' bug has to do with typesetters and
- global search-and-replace.
-
- >Anybody using cc (without lint) on SunOS gets exactly what s/he deserves.
-
- Yes, generally gcc, so s/he can compile real code.
-
- -s
- --
- Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
- C/Unix wizard -- C/Unix questions? Send mail for help. No, really!
- FUCK the communications decency act. Goddamned government. [literally.]
- The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html
-